/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.third.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 第三方单位安全培训记录
 *
 * @author pig
 * @date 2023-11-16 14:06:45
 */
@Data
@TableName("base_third_train_record")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "第三方单位安全培训记录")
public class BaseThirdTrainRecordEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	/**
	* 第三方单位
	*/
    @Schema(description="第三方单位")
	@NotNull(message = "第三方单位不能为空")
    private Long employerId;

	/**
	* 培训名称
	*/
    @Schema(description="培训名称")
	@NotBlank(message = "培训名称不能为空")
    private String trainName;

	/**
	* 开始时间
	*/
    @Schema(description="开始时间")
	@NotNull(message = "开始时间不能为空")
    private Date trainStartTime;

	/**
	* 结束时间
	*/
    @Schema(description="结束时间")
	@NotNull(message = "结束时间不能为空")
    private Date trainStopTime;

	/**
	* 培训讲Date*/
    @Schema(description="培训讲师")
	@NotBlank(message = "培训讲师不能为空")
    private String trainTeacher;

	/**
	* 培训内容
	*/
    @Schema(description="培训内容")
	@NotBlank(message = "培训内容不能为空")
    private String trainContent;

	/**
	* 培训人员
	*/
    @Schema(description="培训人员")
	@NotBlank(message = "培训人员不能为空")
    private String trainEmployeeIds;

	/**
	* 培训时长
	*/
    @Schema(description="培训时长")
	@NotNull(message = "培训时长不能为空")
    private Long trainDuration;

	/**
	* 培训课件
	*/
    @Schema(description="培训课件")
	@NotBlank(message = "培训课件不能为空")
    private String trainCourseware;

	/**
	* 培训人员签到表
	*/
    @Schema(description="培训人员签到表")
	@NotBlank(message = "培训人员签到表不能为空")
    private String trainSignSheet;

	/**
	* 备注说明
	*/
    @Schema(description="备注说明")
    private String remark;

	/**
	* 附件
	*/
    @Schema(description="附件")
    private String attachment;

	public String getEmployerIdStr() {
		return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.third_unit, this.employerId);
	}

	public String getTrainEmployeeIdsStr() {
		return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.third_employee, this.trainEmployeeIds);
	}

	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
	}
}
